<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Relation
 *
 * @author Admin
 */
class Main_Resource_Relation extends WOW_Model_Resource_Db_Table_Abstract implements
Main_Resource_Relation_Interface
{
    protected $_name = 'relations';
    protected $_primary = 'id';
    protected $_rowClass = 'Main_Resource_Relation_Item';

    public function getRelationById($id)
    {
        return $this->find($id)->current();
    }

    public function getAllRelations()
    {
        $select = $this->select()
                       ->order('RelationName');

        return $this->fetchAll($select);
    }

    public function getRelationByIdent($ident)
    {
        $select = $this->select()
                       ->where('relation_ident = ?', $ident);

        return $this->fetchRow($select);
    }
}
?>
